home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
admin
/
squota-0.01
/
squota-0~
/
Squota
/
Squotaday
< prev
Wrap
Text File
|
1996-05-07
|
636b
|
24 lines
#!/bin/bash
# This one add the total at the end of each day
# INIT VARIBLES
. /var/adm/Squota/quotavars
# True Start
while test $EMPTY != $PULENGTH
do
# start on first line
EMPTY=`expr $EMPTY + 1`
#
# get the users name
#
USERSHOME=`head -$EMPTY $HQ/quota.users | tail -1`
if test -d $WHATDIR/$USERSHOME
then
# use expr to do math
# echo out daily totals, format with sed to make " " to " + "
# then divide today with # of days...
FSTOTAL=`echo \`cat $USERSHOME.$MON\` | sed 's/ / + /g'`
echo $DAY$USERSHOME `expr \( $FSTOTAL \) / $DAY` / `expr $FSLIMIT \* 1024`K >>/var/adm/quota.daily.$MON
fi
done